package com.myapp.web.struts2.ui;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
import com.myapp.web.struts2.components.SegmentBean;
import com.opensymphony.xwork2.util.ValueStack;

public class SegmentTag extends AbstractClosingTag {
	private static final long serialVersionUID = -4466803189398118408L;
	
	private String prefixClass;
	
	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req,
			HttpServletResponse res) {
		return new SegmentBean(stack,req,res);		 
	}
	
    protected void populateParams() {
        super.populateParams();
        SegmentBean bean = ((SegmentBean) component);
        bean.setPrefixClass(prefixClass);
    }

	public void setPrefixClass(String prefixClass) {
		this.prefixClass = prefixClass;
	}        
}
